﻿/**************************************************************************************************\
++++++++++++++++++++++++++++++ ARKADIUM INTELLECTUAL PROPERTY TERMS ++++++++++++++++++++++++++++++
The Software is protected by US copyright laws and international treaties. Licensee must treat the 
Software like any other copyrighted material – for example a book. Licensee acknowledges that 
Arkadium owns the Software and that nothing set forth herein conveys to Licensee any ownership in 
or to the Software, including without any Derivative Works of the Software.  
++++++++++++++++++++++++++++++ ARKADIUM INTELLECTUAL PROPERTY TERMS ++++++++++++++++++++++++++++++

AUTHOR: Neil Mrva

PURPOSE: This class should be extended by the Main class in every game. It contains additional 
properties and functionality that every game should have.
\**************************************************************************************************/

class arkadium.Main
{
	// **MEMBER VARIABLES**
	private var _mcStage:MovieClip; // Holds a reference to our stage, which is the _root of this SWF.


	// Main
	private function Main()
	{
		_mcStage = null;
	}
	
	/**************************************************************************************************\
	onInitialize - Tis function's purpose is to initialize anything that every game will use.
	\**************************************************************************************************/
	public function onInitialize( mcStage:MovieClip, bShowLink:Boolean )
	{
		_mcStage = mcStage;
		_mcStage._quality = "BEST";
		
		MovieClip.prototype.tabEnabled = false;
		Button.prototype.tabEnabled = false;
		TextField.prototype.tabEnabled = false;

		System.security.allowDomain("http://freeplay.gamedek.com/");
		
		
		mcStage.stg_mcPBALogo._visible = bShowLink;

		// Let's create a custom flash context menu when the right mouse button is clicked.
		var cContextMenu:ContextMenu = new ContextMenu();
		cContextMenu.hideBuiltInItems();

		// Let's create a new Arkadium link and set it's visibility depending if it's a client game or not.
		var cMenuItem:ContextMenuItem = new ContextMenuItem( "Powered by Arkadium", this.visitArkadium, null, null, bShowLink );
		cContextMenu.customItems.push( cMenuItem );
		
		// Set the root context menu.
		_mcStage.menu = cContextMenu;
	}
	
	/**************************************************************************************************\
	visitArkadium - This function is called by our custom context menu link.
	\**************************************************************************************************/
	private function visitArkadium()
	{
		getURL( "http://www.arkadium.com", "_blank" );
	}
	
}